package com.zhouxiaoge.abstractfactorypattern;

import com.zhouxiaoge.abstractfactorypattern.factory.AbstractFactory;
import com.zhouxiaoge.abstractfactorypattern.factory.ColorFactory;
import com.zhouxiaoge.abstractfactorypattern.factory.ShapeFactory;

public class FactoryProducer {

    public static AbstractFactory getFactory(String choice) {
        if (choice.equalsIgnoreCase("shape")) {
            return new ShapeFactory();
        } else if (choice.equalsIgnoreCase("color")) {
            return new ColorFactory();
        }
        return null;
    }

}
